import os

def listAllFile(filepath, exclude=[]):
    result = []

    files = os.listdir(filepath)
    for fi in files:
        fi_d = os.path.join(filepath, fi)
        if os.path.isfile(fi_d) and fi not in exclude:
            result.append(fi_d)
        elif os.path.isdir(fi_d):
            result += listAllFile(fi_d, exclude)

    return result

def emptyFolder(filepath, exclude=[]):
    files = listAllFile(filepath, exclude)
    for item in files:
        os.remove(item)